import {
	request_post
} from '@/api/request.js'

import {
	getData
} from '@/tools/tools.js'

// 收货列表
export const getShouHuoList = () => {
	return request_post('/receipt_and_warehousing_list',{
		user_id: getData().id
	})
}

// 收货详情
export const getShouHuoMessage = (rec) =>{
	return request_post('/receipt_and_warehousing_xiangqing',{
		user_id: getData().id,
		record_id:rec
	})
}

// 收货产品作业
export const getShouHuoZuoyeList = (rec) =>{
	return request_post('/receipt_and_warehousing_xiangqing_zuoye',{
		user_id: getData().id,
		record_id:rec
	})
}

// 产品详情
export const getChanpinXiangqing = (from) => {
	let fisrtIndex = from.fisrtIndex
	let rec = from.fromId
	let nextIndex = from.nextIndex
	
	return request_post('/repair_action_show_details',{
		user_id: getData().id,
		record_id:rec,
		next_serial:fisrtIndex,
		next_serial_count:nextIndex
	})
}

// 收货验证
export const getShouhuoYanzheng = (rec) =>{
	return request_post('/repair_button_validate',{
		user_id: getData().id,
		record_id:rec,
	})
}

// 产品图片
export const getTupianList = (rec) => {
	return request_post('/receipt_and_warehousing_xiangqing_photos',{
		user_id: getData().id,
		record_id:rec,
	})
}

// 收货入库详情 获取物流公司id 和 名称 
export const getWuliuId = () => {
	return request_post('/shouhuoruku_get_company',{
		user_id: getData().id
	})
}

// 收货入库单修改
export const xiugaiRuku = (data) => {
	return request_post('/receipt_and_warehousing_xiangqing_change',{
		user_id: getData().id,
		record_id:data.recid,
		wuliu_company:data.wuliu,
		fukuan_way:data.fukuan,
		wuliu_free:data.yunfei,
		zhuizong_cankao:data.zhuizong
	})
}
